/*
 * Wazuh databaseFeedManager
 * Copyright (C) 2015, Wazuh Inc.
 * September 26, 2023.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */
#ifndef _TRAMPOLINE_INDEXERCONNECTOR_HPP
#define _TRAMPOLINE_INDEXERCONNECTOR_HPP

#include "MockIndexerConnector.hpp"

extern std::shared_ptr<MockIndexerConnector> spIndexerConnectorMock;

/**
 * @brief This class is a wrapper of the trampoline indexer connector library.
 */
class TrampolineIndexerConnector final
{
public:
    /**
     * @brief Constructor for creating a TrampolineIndexerConnector object.
     *
     * The `TrampolineIndexerConnector` constructor initializes a new instance of the
     * TrampolineIndexerConnector class.
     *
     */
    TrampolineIndexerConnector() = default;

    virtual ~TrampolineIndexerConnector() = default;

    /**
     * @brief Publish a message into the queue map.
     *
     * @param message Message to be published.
     */
    void publish(const std::string& message) const
    {
        spIndexerConnectorMock->publish(message);
    }

    /**
     * @brief Sync the agent with the indexer.
     *
     * @param agentId Agent identifier.
     */
    void sync(const std::string& agentId) const
    {
        spIndexerConnectorMock->sync(agentId);
    }
};

#endif //_TRAMPOLINE_INDEXERCONNECTOR_HPP
